/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    ScrollView,
    TouchableOpacity
} from 'react-native';

import GCStyle from '../../Model/Global/GCStyle';
import OrderList from '../Order/OrderList';
import NoticeMessage from '../AboutMe/Account/NoticeMessage';
import SelectorDate from '../../Model/Component/SelectorDate';

export default class Home extends Component {
    onClickLeft() {
        const {navigator} = this.props;
        if (navigator) {
            navigator.push({
                name: 'NoticeMessage',
                component: NoticeMessage,
            });
        }
    }

    render() {
        return (
            <View style={styles.container}>
                <View style={GCStyle.Style.navigatorView}>
                    <TouchableOpacity onPress={() => this.onClickLeft()}>
                        <Image resizeMode='contain' source={require('../../Resource/Imgs/nav_notice.png')}
                               style={GCStyle.Style.LeftBn}/>
                    </TouchableOpacity>
                    <Text style={GCStyle.Style.titleTxt}>首页</Text>
                    <View style={GCStyle.Style.rightBn}/>
                </View>
                <ScrollView>
                    <OrderList isShowHeader={true} navigator={this.props.navigator}/>
                </ScrollView>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        backgroundColor: '#F4F4F4',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
});

